import com.nevc.Test2;

public class Main {
    private int field1;
    private int field2;
    protected int field3;
    public static int field4;
    public void method1(){
        Main.method2();
        System.out.println("method1");
    }
    public static void method2(){
        System.out.println("method2");
    }

    public static void main(String[] args) {
        Main m = new Main();
        m.method1();
    }
}
class Test{
    private int num1;
    private int num2;
    public int getNum1() {
        return num1;
    }
    public void setNum1(int num1) {
        this.num1 = num1;
    }
    public int getNum2() {
        return num2;
    }
    public void setNum2(int num2) {
        this.num2 = num2;
    }
    public static void main(String[] args) {
        Test t = new Test();
        t.setNum1(10);
        t.setNum2(20);
        System.out.println(t.getNum1());
        System.out.println(t.getNum2());
//        Main.field4 = 5;
//        System.out.println(Main.field4);
//        Main.print();
    }
}

class Test3{
    public void method1(){
        System.out.println("method1");
    }
    public static void method2(){
//        Test3 t3 = new Test3();
//        t3.method1();
//        this.method1();
        System.out.println("method2");
    }

    public static void main(String[] args) {
        Test3.method2();
    }
}

class Test4{
    private String name;
    private String gender;
    private static int grade;

    {
        this.name = "学生1";
        this.gender = "男";
    }
    static {
        Test4.grade = 6;
    }
    public static void main(String[] args) {
        System.out.println(Test4.grade);
        Test4 t4 = new Test4();
        System.out.println("姓名：" + t4.name + "  性别： " + t4.gender);
    }
}

class Test5{
    private String name;
    {
        System.out.println("实例代码块1");
    }
    static {
        System.out.println("静态代码块1");
    }
    Test5()
    {
        System.out.println("构造方法1");
    }

    public static void main(String[] args) {
        Test5 t5 = new Test5();
        Test5 t5_2 = new Test5();
    }
}